package cn.wolfcode.mapper;

import cn.wolfcode.domain.Department;
import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    List<Role> queryList(QueryObject qo);


    /**
     * 查询某个员工的所有角色
     *
     * @param empId 员工的id
     * @return
     */
    List<Role> QueryRoleForEmp(Long empId);

    /**
     * 插入角色和权限中间表数据
     */
    void insertRolePerMiddleTable(@Param("roleId") Long roleId, @Param("perIds") Long perIds[]);

    /**
     * 删除角色和权限中间表数据
     */
    void deleteRolePerMiddleTable(Long roleId);
}